package base.service;

import base.dao.SqlServerTestDao;
import base.model.Result;
import demo.annotation.MyAnnotation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


/**
 * @author : GuoFei
 * @date : 2018/12/22 10:47
 */
@Service
public class SqlServerTestService {

    @Autowired
    private SqlServerTestDao dao;


//    @GFTransactional(need = true)
    @Transactional(readOnly = true,rollbackFor = Exception.class)
    @MyAnnotation(world = "Hello,world",canContinue = true)
    public Result add(boolean canRun){
        int id = dao.add(true,"test_1_","1");
//        int d = dao.add(false,"woyaojinqu","2");
        return Result.success(id);
    }

    public Result list(){
        return Result.success(dao.list(10));
    }

}
